import request from '@/utils/request'



export default{


  testeeSearch(subjectPkId,sitePkId,pageIndex,pageSize) {
    return request({
      url: `/research/testee/search`,
      method: 'post',
      data:{
        subjectPkId:subjectPkId,
        sitePkId:sitePkId,
        pageNum:pageIndex,
        pageSize:pageSize
      }
    })
  },
  testeeSearch2(subjectPkId,sitePkId) {
    return request({
      url: `/research/testee/search`,
      method: 'post',
      data:{
        subjectPkId:subjectPkId,
        sitePkId:sitePkId,
      }
    })
  },
  testeeSearch1(dataForm)
  {

    return request({
      url: `/research/testee/search`,
      method: 'post',
      data:dataForm
    })

  },

  getById(id)
  {
    return request({
      url: `/research/testee/${id}`,
      method: 'get',
    })
  },

  addTestee(data) {
    return request({
      url: `/research/testee`,
      method: 'post',
      data: {
        FUN_TYPE:1,
        INNER_CODE:data.testeeNo,
        PATIENT_NAME:data.name,
        DATE_OF_BIRTH:data.birthday,
        SEX:data.sex,
        SUBJECT_PK_ID:data.subjectPkId,
        SUBJECT_CODE:data.subjectCode,
        SITE_PK_ID:data.sitePkId,
        SITE_CODE:data.siteCode,
        TYPE:data.type
      }
    })
  },

  updateTestee(data) {
    return request({
      url: `/research/testee`,
      method: 'put',
      data: {
        id:data.id,
        name:data.name,
        sex:data.sex,
        birthday:data.birthday,
        testeeNo:data.testeeNo
      }
    })
  },

  updateSite(data) {
    return request({
      url: `/research/testee`,
      method: 'put',
      data: {
        id:data.id,
        sitePkId:data.sitePkId,
        siteName:data.siteName,
        siteCode:data.siteCode,
        personEmail:data.personEmail,
        agencyName:data.agencyName,
        agencyCode:data.agencyCode,
        type:data.type
      }
    })
  },

  deleteTestee(id)
  {
    return request({
      url: `/research/testee/delete/${id}`,
      method: 'POST',
    })
  },
}
